<meta charset="UTF-8">
<style type="text/css">
.modal-header h4{
	font-size: 25px;
}
</style>
<div th:if="${g_bk.size() == 0}">
	<center><img src="static/img/empty.jpg" width="40%"></center>
</div>
<div th:if="${g_bk.size() != 0}">
	<table class="table table-bordered table-hover ">
		<tr>
			<th>申请老师</th>
			<th>申请时间</th>
			<th>停课时间</th>
			<th>停课节次</th>
			<th>课程</th>
			<th>班级</th>
			<th>补课老师</th>
			<th>补课时间</th>
			<th>星期</th>
			<th>补课节次</th>
			<th>补课地点</th>
			<th>状态</th>
			<th colspan="2">操作</th>
		</tr>
		<tr th:each="bk:${g_bk}">
			<td th:text="${bk.user.name}"></td>
			<td th:text="${bk.opplyTime}"></td>
			<td th:text="${bk.suspendTime}"></td>
			<td th:text="${bk.section}"></td>
			<td th:text="${bk.curriculum}"></td>
			<td th:text="${bk.tbClass}"></td>
			<td th:text="${bk.teacher}"></td>
			<td th:text="${bk.repairTime}"></td>
			<td th:text="${bk.week}"></td>
			<td th:text="${bk.jc}"></td>
			<td th:text="${bk.address}"></td>
			<td th:text="${bk.state}"></td>
			<td>
				<button class="btn btn-success btn-sm" th:onclick="'javascript:g_agree3(\''+${bk.id}+'\')'"><span class="glyphicon glyphicon-ok"></span>同意</button>
				<button class="btn btn-danger btn-sm" th:onclick="'javascript:g_refuse3(\''+${bk.id}+'\')'"><span class="glyphicon glyphicon-remove"></span>拒绝</button>
			</td>
		</tr>
	</table>
</div>
<script>
function g_agree3(id){
	bootbox.confirm({
		title:'<span class="glyphicon glyphicon-question-sign"></span> 提示信息',
		message: '<h4>确定同意吗？</h4>',
		buttons: {
            cancel: {
                label: '<i class="glyphicon glyphicon-remove"></i> 取消'
            },
            confirm: {
                label: '<i class="glyphicon glyphicon-ok"></i> 确定'
            }
        },
        callback: function (result) {
        	if(result==true){
        		$.post('ttb/bkController',{id:id, a:1},function(data){
        			$('#g_main').load('ttb/g_adminTtb3');
        			bootbox.alert(data.msg);
        		});
        	}
        }
	});
}
function g_refuse3(id){
	bootbox.prompt({
    	locale:'zh_CN',
    	size: '',
    	title:'相关意见',
        inputType: 'textarea',
        callback: function (result) {
            if(result != null){
            	$.post('ttb/bkController',{id:id, a:2, result: result},function(data){
        			$('#g_main').load('ttb/g_adminTtb3');
        			bootbox.alert(data.msg);
        		});
            }
        }
    });
}
</script>